package com.situ.shoplookweb.controller;

import com.situ.shoplook.common.model.Category;
import com.situ.shoplook.common.service.CategoryService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * @Author xinchen
 * @Date: 2024/09/04/ 10:10
 * @Description
 */
@Controller
public class loginController {
    /**
     * 登录跳转
     * @return
     */
    @GetMapping({"/login", "login.html"})
    public String loginPage() {
        return "mall/login";
    }

    /**
     * 个人信息操作
     */
    @GetMapping("/personal")
    public String personalPage() {
        return "mall/personal";
    }

    /**
     * 注册功能
     */
    @GetMapping({"/register", "register.html"})
    public String registerPage() {
        return "mall/register";
    }

    /**
     * 退出登录功能
     */
    @GetMapping("/logout")
    public String logout(HttpSession httpSession) {
        httpSession.removeAttribute("newBeeMallUser");
        return "mall/login";
    }

}
